package com.squo.ru.ebancky;

//import android.content.res.Resources;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class SectionPagerAdapter extends FragmentPagerAdapter{
	public SectionPagerAdapter(FragmentManager fm){
		super(fm);
	}

	@Override
	public int getCount() {
		return 3;
	}

	@Override
	public Fragment getItem(int position) {
		Fragment fragment = new Fragment();
		switch (position) {
		case 0:
			return fragment = new AllTorrentsFragment();
		case 1:
			return fragment = new AllDownloadsFragment();
		case 2:
			return fragment = new AllUploadsFragment();
		default:
			break;
		}
		return fragment;
	}
	@Override
	public CharSequence getPageTitle(int position){
		//TODO Localize page titles
		String pageTitle = null;
		switch (position) {
		case 0:
			pageTitle = "All torrents";
			break;
		case 1:
			pageTitle = "All downloads";
			break;
		case 2:
			pageTitle = "All uploads";
			break;
		default:
			break;
		}
		return pageTitle;
	}
	}
